package com.health.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.health.system.common.validated.groups.UpdateGroup;
import com.health.system.entity.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@TableName("menu")
@ApiModel(value = "菜单实体类")
public class Menu extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "菜单id不能为空", groups = UpdateGroup.class)
    @ApiModelProperty("菜单id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    @NotBlank(message = "菜单名称不能为空")
    @ApiModelProperty("名称")
    private String name;

    @NotNull(message = "父级菜单id不能为空")
    @ApiModelProperty("父级菜单id")
    private Long parentId;


    @NotBlank(message = "图标不能为空")
    @ApiModelProperty("图标")
    private String icon;

    @NotBlank(message = "路径不能为空")
    @ApiModelProperty("路径")
    private String path;

    @NotBlank(message = "组件不能为空")
    @ApiModelProperty("组件")
    private String component;

    @NotNull(message = "排序不能为空")
    @ApiModelProperty("排序")
    private Integer orderNum;

    @ApiModelProperty("隐藏状态")
    private Boolean isHidden;
}
